Skip to content

Conversation

@HeartLinked
Copy link
Contributor

@HeartLinked HeartLinked commented Sep 29, 2025

This PR depends on and should be merged after #230. #249 #245 #248

@HeartLinked HeartLinked force-pushed the feat/catalog-json branch 3 times, most recently from ca9db4e to c27891e Compare October 15, 2025 08:39
@HeartLinked HeartLinked marked this pull request as ready for review October 15, 2025 09:04
@HeartLinked HeartLinked changed the title feat: Implement JSON serialization for REST Catalog API types feat: add REST Catalog request/response models with JSON (de)serialization Oct 20, 2025
Copy link
Member

@wgtmac wgtmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! I mainly have two feedbacks other than those inline comments:

  1. All Java request and reposes classes inherit from RESTMessage below with a validate method. I think this is important because these objects may be created out of our control and must be validated before use.
/** Interface to mark both REST requests and responses. */
public interface RESTMessage {

  /**
   * Ensures that a constructed instance of a REST message is valid according to the REST spec.
   *
   * <p>This is needed when parsing data that comes from external sources and the object might have
   * been constructed without all the required fields present.
   */
  void validate();
}

I'd propose to add a iceberg/catalog/rest/validator with interface like below for every request and response:

struct Validator {
  static Status Validate(const ListNamespacesResponse& resp);
  ...
};
  1. Interoperability is our top priority. I have followed all Java test cases for TableMetadata serde by adding them to src/iceberg/test/metadata_serde_test.cc. There are a lot of test in the Java repo like org/apache/iceberg/rest/responses/TestListNamespacesResponse.java which contains both good and bad cases. It would be good to include them while implementing each objects.

@HeartLinked HeartLinked changed the title feat: add REST Catalog request/response models with JSON (de)serialization feat: add json serde for REST Catalog request/response models Oct 30, 2025
Copy link
Member

@wgtmac wgtmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

@wgtmac wgtmac merged commit c24102e into apache:main Nov 3, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants